
/*var和let 的区别*/


//不存在变量提升
/*
console.log(foo);//undefined
var foo = 1;


console.log(bar);//index.js:11 Uncaught ReferenceError: bar is not defined(…)

let bar = 0;
*/


//块内部的let和全局变量

/*
var tmp = 12;

//let 在块级作用域内的变量，必须是在变量赋值前。
var a = function(){
	tmp = 'abc';
	let tmp;
}();

*/

/*let声明和var声明*/
//var x = x;

//console.log(x);//undefined

//let x = x;//x is not defined(…)


/*不重复声明*/
//let不允许在相同作用域内，重复声明同一个变量
//报错:Identifier 'a' has already been declared
/*function foo(){
	let a = 10;
	var a = 12;
}*/

/*function bar(){
	let a = 12;
	let a = 10;
}*/

//所以不能再函数内部重新声明参数

/*//报错：Uncaught SyntaxError: Identifier 'pram' has already been declared
function foo(pram){
	let pram;//相当于重复命名了
}*/
//但是 这样是可以的，不在这个块级里面同级就行可以。
//不报错
/*(function bar(pram){
	{
		let pram;
		console.log(pram);//undefined
		
		console.log( typeof pram);
	}
})();*/



var foo = (num) =>{
	
	
	
	console.log(num);
};


foo(123)











